//
//  ControlsViewController.swift
//  SyanYan
//
//  Created by Yanyan Jiang on 2018/10/7.
//  Copyright © 2018年 Yanyan Jiang. All rights reserved.
//

import UIKit

class ControlsViewController: UIViewController {
    
    var pppp:String = "pppp"
    override func viewDidLoad() {
        super.viewDidLoad()
        print("调用了吗")
    }
    
   public func controlsMethod() -> () {

        let btn:UIButton = UIButton(frame: CGRect(x:100, y:100, width: 100, height: 100))
        btn.backgroundColor = UIColor.magenta
        btn.setTitle("普通状态", for: UIControlState.normal)
        btn.setTitleColor(UIColor.white, for: .normal)
        btn.setTitle("选中状态", for: .selected)
        btn.setTitleColor(UIColor.black, for: .selected)
        btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
        btn.layer.cornerRadius = 5;
        btn.layer.masksToBounds = true
        btn.addTarget(self, action: Selector(("methodName:")), for: .touchUpInside)
        self.view.addSubview(btn)
    }
    
    func methodName(sender:UIButton) -> () {
       print("buttonTitle")
    }
    
}
